//
//  JNTWorkbenchViewController.m
//  OA
//
//  Created by 王文晓 on 16/8/4.
//  Copyright © 2016年 王文晓. All rights reserved.
//
#import "JNTWorkbenchViewController.h"
#import "JNTTaskViewController.h"
#import "JNTMailViewController.h"
@interface JNTWorkbenchViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, strong) UITableView *tableView;
@end

@implementation JNTWorkbenchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpNavgationBar];
    [self.view addSubview:self.tableView];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 50;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    JNTWorkbenchTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"JNTWorkbenchCELL" forIndexPath:indexPath];
    
    
    if (indexPath.row == 0) {
        
        cell.titleLabel.text = @"移动云平台";
        
        
    }else if (indexPath.row == 1){
        
        cell.titleLabel.text = @"BPM系统";

        
    }else{
        
        cell.titleLabel.text = @"集团OA";

        
    }
    
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        JNTTaskViewController *taskVC = [[JNTTaskViewController alloc]init];
        taskVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:taskVC animated:YES];
       

        NSLog(@"1");
        
    }else if (indexPath.row == 1){
        
//        JNTLog(@"我是第二个");
        
        
    }else if (indexPath.row == 2){
        
//        JNTLog(@"我是第三个");
        
    }
    
}

#pragma mark - 设置导航条
- (void)setUpNavgationBar
{
    self.navigationController.navigationBar.translucent = NO;
//    self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"上栏"] forBarMetrics:UIBarMetricsDefault];
    self.navigationItem.title = @"工作台";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
}




#pragma mark ---视图初始化--
-(UITableView *)tableView {
    
    if (!_tableView) {
        
        _tableView = [[UITableView alloc]initWithFrame:kRect(0, 0, kScreenWidth, kScreenHeight) style:UITableViewStyleGrouped];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        [_tableView registerNib:[UINib nibWithNibName:@"JNTWorkbenchTableViewCell" bundle:nil] forCellReuseIdentifier:@"JNTWorkbenchCELL"];
    }
    return _tableView;
}






@end

